<?php

/**
 * Manage all configurations for the application
 * @author Panthro
 *
 */
class Application {

	public $Url = "http://localhost/twit2promo";
	public $Title = "Twit2Promo";
	public $ComponentsPath ="php/components";
	public $Style =  'default';
	public $localeURI;
	private $localesPath = "php/lib/config/";
	private $defaultLocale = "en_US";
	
	function Application($locale=null){
		
		
		
	}
	
};


class ApplicationDAO  {
	protected $Host = "localhost";
	protected $Database = "twit2promo";
	protected $User = "twit2promo";
	protected $Password = "MinhaSenha";
	public $Connection;
	public $Error = false;
	public $ErrorMessage = "";
	
	function ApplicationDAO(){
		$this->Connection = mysql_connect($this->Host,$this->User, $this->Password);
		mysql_select_db($this->Database, $this->Connection );
	} 
	
	function executeQuery($query){
		if($rs = mysql_query($query,$this->Connection)){
			return mysql_fetch_object($rs);
		}else{
			return false;
		}
	}
	
	function parseObject($objResult){
		foreach ($objResult as $key => $value) {
			$this->$key = $value;
		}
	}
}